#import "Level1Scene.h"

@implementation Level1Scene

-(id) init
{
    if( (self = [super init]) )
    {
		//Get the Window SIze 
		CGSize winSize = [[CCDirector sharedDirector] winSize];
		const float hudLayerHeight = 0.15f;
		
		//Create HUD Layer
		self.hudLayer = [HUDLayer node];
		[hudLayer setPosition:CGPointMake(0, 0)];
		[self addChild:hudLayer z:1];
		
		//Init Layer
        self.layer = [Level1Layer node];
        [layer setDelegate:self];
		[layer setPosition:CGPointMake(0, winSize.height * hudLayerHeight)];
        [self addChild:layer z:0];
        

		
        //init first wave
        [self startLevel];
    }
    
    return self;

}

-(void) dealloc
{
    [super dealloc];
}

-(void) startWave:(int)wave
{
    switch (wave) {
        case 1:
            [layer createSprites:[self genAnswer:12 min:1 max:12] wave:wave];
            break;
        case 2:
            [layer createSprites:[self genAnswer:12 min:1 max:12] wave:wave];
            break;
        case 3:
            [layer createSprites:[self genAnswer:12 min:1 max:12] wave:wave];
            break;
        default:
            break;
    }
	
	[layer startWave:wave];
}


@end
	